/**
*	输入验证
*/

$.extend($.fn.validatebox.defaults.rules, {
    minLength: {
		validator: function(value, param){
			return value.length >= param[0];
		},
		message: 'Please enter at least {0} characters.'
    },
	
	number: {
		validator: function (value, param) {
			return /^[0-9]+.?[0-9]*$/.test(value);
		},
		message: '请输入数字'
	},
    
    mobile: {
		validator: function (value, param) {
			return /^(?:13\d|15\d|18\d)-?\d{5}(\d{3}|\*{3})$/.test(value);
		},
		message: '手机号码不正确'
	},
	
	name: {
		validator: function (value, param) {
			return /^[A-z]+$|^[\u4E00-\u9FA5]+$/.test(value);
		},
		message: '请输入纯汉字或纯英文'
	},
	 equals: {
			validator: function(value,param){
				return value == $(param[0]).val();
			},
			message: '两次密码输入不一致'
	 },
    code: {
		validator: function (value, param) {
			return /^[0-9a-zA-Z]*$/g.test(value);
		},
		message: '请输入正确账号（字母或数字）'
	},
});